require.config({
    baseUrl : './js',
    urlArgs : '_=' + new Date().getTime(),
    paths : {
        'jquery' : ['plugins/jquery-3.2.1.min' , 'https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min'],
        'FastClick' : ['plugins/fastclick'],
        'layer' : ['plugins/layer'],
        'layerWin' : ['layerWin']
    }
});


requirejs(['jquery' , 'FastClick' ,  'layerWin'] , function($ , FastClick ,  layerWin){
    $(function(){
        FastClick.attach(document.body);

        // 获取验证码
        $("#getBtn").on("click",function(){



            var time = 10;
            $(this).attr("disabled" , "disabled").addClass("disGet").html(time + "S");
            var timer = setInterval(function(){
                if(time > 0){
                    time--;
                    $("#getBtn").html(time + "S");
                } else {
                    $("#getBtn").html("重新获取").removeAttr("disabled").removeClass("disGet");
                    clearInterval(timer);
                }
            },1000);
        });


        // 提交验证码
        $("#submitBtn").on("click",function(){
            var yzVal = $("#yzCode").val();
            if(yzVal.length === 0){
                layerWin.layerInfo("请输入正确的验证码！");
                return false;
            }
        });
    });
});